<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>{php echo empty($config['formtitle'])?$theme['title']:$config['formtitle'];}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
  <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORK2020_CSS']}css/reset.css">
  <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORK2020_CSS']}css/swiper.min.css">
  <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORK2020_CSS']}css/style.css?v=4">
  <!-- <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORK2020_CSS']}css/other.css?v=21"> -->
  <script src="{$_G['URL']['WORK2020_CSS']}js/screen.js"></script>
  <script src="{$_G['URL']['WORK2020_CSS']}js/jquery.js"></script>
  <style type="text/css">      
    .mybtn-con{
      background-color: #5c99f7;
      border-radius: 3rem;
      margin-top: 0.60rem;
      color: #fff;
      font-size: 0.38rem;
      width: 4rem;
      line-height: 0.8rem;
    }
    .copyRight{
      margin: 0.30rem;
      line-height: 0.8rem;
    }
    .radio {
        margin-right: .4rem;
        line-height: .6rem;
        font-size: .34rem;
        background-size: .37rem auto;
        width: 1.5rem;
        white-space:nowrap;
    }
  </style>
 </head>
 <body style="background:#f8f8f8">
 	<div class="setTitle" style="height:auto;background:none;">
    	<img src="{php echo tomedia($config['formimg']);}">
    </div>

    <form action='{php echo "/".createMobileUrl('formsaveinfo',array("op"=>"save","themeid"=>$themeid));}' onsubmit="return validate_form(this)" method="post">  
    <div class="setActive">
    	<div class="actTit">
        	请填写以下信息
        </div>
        <ul>
        	<li>
            	<p>{$config['nametext']}</p>
                <input type="text" placeholder="请输入{$config['nametext']}" type="text" name="username" value="{$_G['member']['username']}" id="username">
            </li>
            <li>
            	<p>{$config['mobiletext']}</p>
                <input type="text" placeholder="请输入{$config['mobiletext']}"  type="tel" maxlength="11" name="mobile" value="{$_G['member']['mobile']}" id="mobile">
            </li>
            {if $system['gift'] != 1 }
                {if !empty($config['address'])}
                    <li>
                    <p>{$config['address']}</p>
                    {if $config['addresstype'] == 2 }
                        {if !empty($config['addressoptions'])}
                            <select id="address" name="address">
                                <option value="">请选择{$config['address']}</option>
                                {loop $config['addressoptions'] $row}
                                <option value="{$row}" {if $row==$member['address']}selected="selected"{/if}>{$row}</option>
                                {/loop}
                            </select>
                        {/if} 
                    {else}
                        <input type="text" placeholder="请输入{$config['address']}"   type="{php echo $config['addresstype']==1?'tel':'text';}"  name="address"  id="address" value="{$member['address']}">
                    {/if}
                    </li>
                {else}
                <input  type="hidden" name="address" value="默认" id="address">
                {/if}
            {/if}
            {if !empty($config['shops'])}
                <li>
                <p>{$config['shops']}</p>
                {if $config['shopstype'] == 0 }
                    {if !empty($config['options'])}
                        <select id="shoptitle" name="shoptitle">
                            <option value="">请选择{$config['shops']}</option>
                            {loop $config['options'] $row}
                            <option value="{$row}" {if $row==$member['option']}selected="selected"{/if}>{$row}</option>
                            {/loop}
                        </select>
                    {/if}
                {elseif $config['shopstype'] == 1 || $config['shopstype'] == 2  }
                    <input type="text" placeholder="请输入{$config['shops']}"   type="{php echo $config['shopstype']==2?'tel':'text';}"  name="shoptitle"  id="shoptitle" value="{$member['option']}">
                {elseif $config['shopstype'] == 3  }
                    <div>
                    {if !empty($config['options'])}
                        {loop $config['options'] $row}
                        <label  class="radio"><input style="width: 0.34rem;height: 0.28rem;" name="shoptitle" type="radio" {if $row==$member['option']}selected="selected"{/if} value="{$row}"/>{$row} </label>
                        {/loop}
                    {/if}
                    </div>                    

                {elseif $config['shopstype'] == 4  }
                    <div>
                    {if !empty($config['options'])}
                        {loop $config['options'] $row}
                        <label  class="radio"><input style="width: 0.34rem;height: 0.28rem;" name="shoptitle[]" type="checkbox" {if $row==$member['option']}selected="selected"{/if} value="{$row}" />{$row} </label>
                        {/loop}
                    {/if}
                    </div>  
                {/if}
                </li>
            {else}
            <input  type="hidden" name="shoptitle" value="默认" id="shoptitle">
            {/if}
            {if $config['datetimetype'] > 0 }
            <li>
                <p>{$config['datetime']}</p>
                <input type="text" placeholder="请输入{$config['datetime']}"   type="{php echo $config['datetimetype']==2?'tel':'text';}"  name="datetime"  id="datetime" value="{$member['datetime']}">
            </li>
            {else}
            <li>
            	<p>{$config['datetime']}</p>
                <input  placeholder="{$config['datetime']}" type="date" value="{$member['datetime']}" name="datetime" id="datetime">
            </li>
            {/if}            
        </ul>
        <div style="text-align: center;">
            <button  class="mybtn-con">提交</button>
        </div>
    </div>
    </form>
    {if $theme['yixuanbanquan'] != '1'}
        <div class="copyRight">
        <a style="font-size:12px; color: #333333; " href="{php echo empty($theme['USERURL'])?$system['s']['yixuanurl']:$theme['USERURL'];}">{php echo empty($theme['USERJISHU'])?$system['s']['yixuanjishu']:html_entity_decode($theme['USERJISHU'], ENT_QUOTES);}</a>
        </div>
    {/if}
 </body>

<script type="text/javascript">
    function validate_required(field,alerttxt)
    {
    with (field)
      {
      if (value==null||value=="")
        {alert(alerttxt);return false}
      else {return true}
      }
    }

    function validate_form(thisform)
    {
    with (thisform)
      {
      if (validate_required(username,"请输入{$config['nametext']}")==false)
        {username.focus();return false}
      if (validate_required(mobile,"请输入{$config['mobiletext']}")==false)
        {mobile.focus();return false}
      if (mobile.value.length != 11)
        {alert('请正确输入11位的手机号' );return false}
      if (validate_required(address,"请{php echo $config['addresstype'] == 2?'选择':'输入';}{$config['address']}")==false)
        {return false}
      if (validate_required(shoptitle,"请{php echo $config['shopstype'] == 1 || $config['shopstype'] == 2?'输入':'选择';}{$config['shops']}")==false)
        {return false}
      if (validate_required(datetime,"请{php echo $config['datetimetype'] == 0?'选择':'输入';}{$config['datetime']}")==false)
        {return false}
      }
    }
</script>
</html>
